import { takeEvery, put, delay } from 'redux-saga/effects';
// takeEvery 接收 action
// put 触发 action
import { increment, increment_async } from '../actions/countActions';
// import { INCREMENT_ASYNC } from '../const/counter.const';

function* increment_async_fn(action) {
  console.log(action);
  yield delay(2000);
  yield put(increment(action.payload));
}

export default function* counterSaga() {
  yield takeEvery(increment_async, increment_async_fn);
}